Switch to use romanisim#100
Conversation
93c4cf2 to
ac91f55
Compare
|
romanisim.models has not yet been included in the current release (v0.13.1) of romanisim. The merge needs to wait until the next release version. |
|
I updated the romanisim dependency in pyproject.toml to point to the main branch, and all unit tests are now passing. I think the code is ready for review now. @arunkannawadi |
88819ea to
414da08
Compare
arunkannawadi
left a comment
There was a problem hiding this comment.
I have reviewed everything expect for the changes in psf.py. Given the slowness you report, I think that needs some investigation.
It seems like the efficiency issue appears in both this branch and the integrated_coadd_sim branch (which doesn't use romanisim.models yet). I'm running some tests now. |
8ebb3be to
97ea3b9
Compare
I ran a round of code profiling last week and found that the performance issues previously observed in this branch were likely caused by some temporary problems on the DCC side. I've rebased the branch. It should now be ready for merging or any further review. |
| def __init__( | ||
| self, | ||
| SCA=None, | ||
| WCS=None, | ||
| n_waves=None, | ||
| bpass=None, | ||
| extra_aberrations=None, | ||
| logger=None, | ||
| ): | ||
|
|
||
| logger = galsim.config.LoggerWrapper(logger) | ||
|
|
||
| if n_waves == -1: | ||
| if bpass.name == "W146": | ||
| n_waves = 10 | ||
| else: | ||
| n_waves = 5 | ||
|
|
||
| corners = [ | ||
| galsim.PositionD(1, 1), | ||
| galsim.PositionD(1, models.parameters.n_pix), | ||
| galsim.PositionD(models.parameters.n_pix, 1), | ||
| galsim.PositionD(models.parameters.n_pix, models.parameters.n_pix), | ||
| ] | ||
| cc = galsim.PositionD(models.parameters.n_pix / 2, models.parameters.n_pix / 2) | ||
| tags = ["ll", "lu", "ul", "uu"] | ||
| self.PSF = {} | ||
| pupil_bin = 8 | ||
| self.PSF[pupil_bin] = {} | ||
| for tag, SCA_pos in tuple(zip(tags, corners)): | ||
| self.PSF[pupil_bin][tag] = self._psf_call( | ||
| SCA, bpass, SCA_pos, WCS, pupil_bin, n_waves, logger, extra_aberrations | ||
| ) | ||
| for pupil_bin in [4, 2, "achromatic"]: | ||
| self.PSF[pupil_bin] = self._psf_call( | ||
| SCA, bpass, cc, WCS, pupil_bin, n_waves, logger, extra_aberrations | ||
| ) | ||
|
|
There was a problem hiding this comment.
Why is this added back here?
The PSFInterpolator is not supposed to be changed. It is only use as a constructor for specific interpolation scheme. What is being added here is already in the initPSF of the CornerPSFInterpolator see here.
Also this modification has nothing to do with this PR, is there is an issue/bug with the PSF implementation please make a separate PR to make it easier to track.
| def buildPSF(self, config, base, gsparams, logger): | ||
| """Build the PSF object. | ||
|
|
||
| For the Basic stamp type, this builds a PSF from the base['psf'] dict, if present, | ||
| else returns None. | ||
|
|
||
| Parameters: | ||
| config: The configuration dict for the stamp field. | ||
| base: The base configuration dict. | ||
| gsparams: A dict of kwargs to use for a GSParams. More may be added to this | ||
| list by the galaxy object. | ||
| logger: A logger object to log progress. | ||
|
|
||
| Returns: | ||
| the PSF | ||
| """ | ||
| if base.get("psf", {}).get("type", "roman_psf") != "roman_psf": | ||
| return galsim.config.BuildGSObject(base, "psf", gsparams=gsparams, logger=logger)[0] | ||
|
|
||
| roman_psf = galsim.config.GetInputObj("roman_psf", config, base, "buildPSF") | ||
| psf = roman_psf.getPSF(self.pupil_bin, base["image_pos"]) | ||
| return psf | ||
|
|
There was a problem hiding this comment.
Why is this beeing added back?
Same as the comment above, if there is a specific issue with the PSF it would be easier in a separate PR.
This RP migrates the codebase to a new set of APIs in romanisim (here's an introduction of the new API), replacing all usages of galsim.roman. This change enables access to both CRDS and the roman-technical-information repository.
Current status:
noise.pyTODO / Open Questions (for this PR):
TODO / Open Questions (out of scope for this PR):